dock_map = {}

INPUT_CSV_NAME = 'taxi_february.txt'
OUTPUT_CSV_NAME = 'data.csv'

with open(INPUT_CSV_NAME) as txt:
    for line in txt.readlines():
        tokens = line.split()
        if int(tokens[0]) not in dock_map.keys():
            dock_map[int(tokens[0])]=(float(tokens[-4]),float(tokens[-3]))
print("found "+str(len(dock_map.keys()))+" dock.")
with open(OUTPUT_CSV_NAME,'w') as csv:
    for id in dock_map.keys():
        csv.write("{},{},{}\n".format(id,dock_map[id][0],dock_map[id][1]))